<? if ($c = stack('name')) {

	$d = component_data($c); 
	$s = component_settings($c);
	
	
startScript(); ?><script type="text/javascript">jQuery(function($) {<?

	 switch($s['nav']) {
		 
		 case 0: // scrollable
		
?>	$("#cpn-<?=$c?> .scrollable").scrollable({
		mousewheel:true
		<?=$s['circular'] ? ', circular:true' : ''?>
	})<?=$s['navigator'] ? '.navigator()' : ''?><?=$s['autoscroll'] ? '.autoscroll(7000)' : ''?>;
<?
			break;
	 }
	
?> });</script><? endScript();


	?><section id="cpn-<?=$c?>" class="cpn-videos"><?

	if ($s['caption']) { ?><hgroup class="cpn-videos-caption"><?=$s['caption']?></hgroup><? }
	
	if (sizeof($d)) {

		/* <div class="navi navi-above"></div> */

		?><a class="prev browse left"></a><div class="scrollable"><div class="items"><?

		
		foreach($d as $id => $v) {
//			$url = ($s['param'] == 'id') ? $id : "$s[param]-$id";
			
			?><div class="container"><div class="wrapper"><?=$v['template']?>
				<h4 class="title"><?=$v['title']?></h4>
				<div class="descr"><?=$v['body']?></div>
			</div></div><?
		} 
		
		?></div></div><a class="next browse right"></a><?
		
		?><div class="navi navi-below"></div><?

		?><div class="clearer"></div><?
		
	}
	
	?></section><?
	
 
	unstack();
}